import server from '../index.js'

function post(path, auth = true, config = true) {
  return server.api().post(path).auth(auth).config(config)
}

function get(path, auth = true, config = true) {
  return server.api().get(path).auth(auth).config(config)
}
export default {
  importParameterExcel: server.api().upload('/dt-customer/parameter/importParameterExcel'), //导入台账
  teams: {
    // 查询顾问当前楼盘下的客户数 入参buildingId
    getCustomerCountByUser: post('/dt-customer/user/customer/getCustomerCountByUser'),
    //根据顾问ID查询该顾问案场下可以进入公客池的客户数
    getCustomerPoolCountByUser: post('/dt-customer/user/customer/getCustomerPoolCountByUser')
  },

  // 案场首页
  buildingHome: {
    visitorExport: post('/dt-customer/statistics/web/listCustomerAndClue/export').tag('downloadCenter'), // 来访统计
    followUpExport: post('/dt-customer/statistics/web/followUpExport').tag('downloadCenter'), // 客户跟进统计
    infoPerfectExport: post('/dt-customer/statistics/web/infoPerfectExport').tag('downloadCenter'), // 客户信息完善统计
    planExport: post('/dt-customer/statistics/web/planExport').tag('downloadCenter') // 置业计划书统计
  },

  count: {
    customerSummary: post('/dt-customer/statistics/web/querySummary'),
    customerInfo: post('/dt-customer/statistics/web/infoPerfect'),
    customerFollowUp: post('/dt-customer/statistics/web/followUp'),
    customerPageQuery: post('/dt-customer/statistics/web/listCustomerAndClue'), // 来访统计
    infoPerfectDetail: post('/dt-customer/statistics/web/infoPerfectDetail'), // 完善统计
    housePlanQuery: post('/dt-customer/statistics/web/pagePlanQuery'), // 置业计划书
    followUpDetail: post('/dt-customer/statistics/web/followUpDetail'), // 跟进统计
    clueCount: post('/dt-customer/statistics/web/clueCount'), // 线索
    customerCount: post('/dt-customer/customerList/web/customerCount'), // 到访
    userIntegralExport: post('/dt-customer/statistics/web/export').tag('downloadCenter') // 导出顾问积分
  },

  //平台Sop任务
  platSop: {
    getSopPlatformConfig: post('/dt-customer/sopConfig/getSopPlatformConfig'), // 获取平台Sop配置
    auditPlatformSwitch: post('/dt-customer/sopConfig/auditPlatformSwitch') // SOP平台审核/任务开关
  },
  buildingManagement: {
    getBuildingSopConfig: post('/dt-customer/sopConfig/getBuildingSopConfig'), //获取案场SOP配置
    auditSwitch: post('/dt-customer/sopConfig/auditSwitch'), //SOP审核开关
    editRule: post('/dt-customer/sopConfig/editRule'), //编辑特殊规则
    importCustomerList: post('/dt-customer/userImportParameterRecord/getList'), // 导入台账的列表
    getSopConfig: post('/dt-customer/sopConfig/internal/getSopConfig'), //获取单个案场SOP配置
    earlyShutdown: post('/dt-customer/sopConfig/earlyShutdown') //提前关闭
  },

  customer: {
    customerinfoHeadList: post('/dt-customer/customerHead/list'),
    getCustomerInfoAll: post('/dt-customer/customerDy/getCustomerInfoAll'), //新DT客户详情 customerDy/getCustomerInfoAll
    importCustomerList: post('/dt-customer/userImportParameterRecord/getList'), // 导入台账的列表

    customerAssignment: post('/dt-customer/user/customer/distribute'), //专案客户分配
    // customerHeadList: post('/dt-customer/customerHead/list'), // 客户列表表头-编辑显示字段列表查询
    customerHeadList: post('/dt-customer/customerHead/list'), // 客户列表表头-编辑显示字段列表查询

    customerHeadUpdate: post('/dt-customer/customerHead/update'), //客户表头修改
    followUp: post('/dt-customer/followUpRecord/getFollowUp'), //客户跟进记录
    updateFollowUp: post('/dt-customer/followUpRecord/updateFollowUp'), //更新跟进记录
    insertFollowUp: post('/dt-customer/followUpRecord/insertFollowUp'), //插入批注
    getCustomerListNew: post('/dt-customer/customerList/webList'), ////客户列表新的
    webGetCustomerDynamicList: post('/dt-customer/customerDy/webGetCustomerDynamicList'), //客户动态列表接口

    // getUserByName: post('/dt-customer/web/customer/user/getUserByName'), ////筛选顾问列表
    // getUserByName: post('/dt-user/v1/building/team/user/getTeamUser'), ////筛选顾问列表------接口更改
    changeAttention: post('/dt-customer/user/customer/changeAttention'), ////客户关注
    exportParameterExcel: server
      .api()
      .download('/dt-customer/userImportParameterRecord/exportParameterExcel'), //客户导入明细

    getDistributeLogPage: post('/dt-customer/customerDistributeLog/getDistributeLogPage'), //分配记录
    getDistributeLogPageDetails: post('/dt-customer/customerDistributeLog/getDistributeLogPageDetails'), //分配记录的客户详情
    checkDistributeList: post('/dt-customer/customerDistributeLog/checkDistributeList'), //校验是否有重新分配的客户集合

    updateCustomerChannel: post('/dt-customer/customer/updateCustomerChannel'),

    // 到访客户分配统计
    customerListAssignmentCount: post('dt-customer/customerList/web/assignment/list/count'),
    visitDistribute: post('dt-customer/user/customer/web/distribute'), //到访客户分配

    getDistributeLogPageExport: post('/dt-customer/customerDistributeLog/list/export').tag('downloadCenter') //分配记录导出
  },

  // 台账相关
  standBookList: {
    //台账字段库列表 有案场Id则查询案场台账 无案场ID查询公司台账
    getStandingBookGetAll: post('/dt-customer/standingbook/company/getAll'),
    updateStandingBook: post('/dt-customer/fieldLib/updateCompanyField'),

    detailStandingBook: post('/dt-customer/standingbook/company/get'), //台账详情
    standingbookShowPort: post('/dt-customer/standingbook/standingbookShowPort/list'),

    // 本案台账
    getStandingBookGetAllBuildPages: post('/dt-customer/standingbook/building/page'), //获取本案台账（分页）

    getstandingBookGetGroup: post('/dt-customer/standingbook/building/group'), //案场台账列表（分组）
    fieldLib: post('/dt-customer/fieldLib/all/[buildingId]'),
    createField: post('/dt-customer/fieldLib/createField'),
    fieldBatchUpdate: post('/dt-customer/fieldLib/batchUpdate'),
    delField: post('/dt-customer/fieldLib/delField')
  },
  // 线索客户
  clue: {
    list: post('/dt-customer/clUserCustomer/getClueListWeb'),
    count: post('/dt-customer/clUserCustomer/getClueNumerWeb'),
    export: post('/dt-customer/clUserCustomer/getClueListWeb/export').tag('downloadCenter'),
    distribution: post('/dt-customer/clUserCustomer/appList/distributionClue'),
    info: post('/dt-customer/clUserCustomer/getCustomerInfoAll'),

    // 到访记录
    counselorRecord: post('/dt-customer/customer/clue/counselorRecord'),
    // 到访记录总数
    customerVisitRecord: get('/dt-customer/customer/clue/customerVisitRecord'),

    // 更过顾问到访记录总数
    moreCounselorRecord: post('/dt-customer/customer/clue/moreCounselorRecord'),

    // 到访记录导出
    visitRecordExport: post('/dt-customer/customer/clue/counselorRecordExport').tag('downloadCenter'),

    // 线索客户列表
    clueCustomerList: post('/dt-customer/customer/clue/web/clueList'),
    clueCustomerCount: post('/dt-customer/customer/clue/web/clueCount'),

    // 线索客户分配记录list
    customerClueDistribution: post('/dt-customer/customerClueDistribution/page'),
    // 分配线索客户
    distributeClue: post('/dt-customer/customerClueDistribution/distributeClue'),

    //  线索客户分配记录导出
    customerClueDistributionExport: post('/dt-customer/customerClueDistribution/list/export').tag(
      'downloadCenter'
    ),
    // 线索表头，以及更新
    clueHeadList: post('/dt-customer/clUserCustomerHead/list'),
    clueHeadUpdate: post('/dt-customer/clUserCustomerHead/update'),
    clueListExport: post('/dt-customer/customer/clue/web/clueList/export').tag('downloadCenter'),

    // 判断当前客户是否存在多个顾问维护
    isMoreCounselor: get('/dt-customer/customer/clue/isMoreCounselor'),
    // 根据姓名 手机号查询线索客户
    getCustomerByNameOrPhone: post('/dt-customer/customer/getCustomerByNameOrPhone'),
    getInvalidCauseList: get('/dt-customer/customer/clue/getInvalidCauseList'), //查询无效原因文案列表
    clueDistributionList: post('/dt-customer/customer/clue/clueDistributionList'), //线索客户分配列表
    clueDistributionListCount: post('/dt-customer/customer/clue/clueDistributionList/count'), //线索客户分配列表统计
    setInvalidCustomer: post('/dt-customer/customer/clue/setInvalidCustomer'), //设为无效客户

    clueAssignmentostClueCount: post('dt-customer/customer/clue/web/assignment/clueCount'), //线索客户分配统计

    clueDistributeClue: post('dt-customer/customerClueDistribution/web/distributeClue') //线索客户分配
  },
  // 公客池
  publicCustomer: {
    // publicCustomerList: post('/dt-customer/customerPublicPool/web/list'), // 此接口已废弃
    publicCustomerList: post('/dt-customer/customerPublicPool/web/clueList'), // 公客池线索列表
    publicCustomerVisitList: post('/dt-customer/customerPublicPool/web/customerList'), // 公客池到访列表
    // publicCustomerCount: post('/dt-customer/customerPublicPool/web/list/count'), // 此接口已废弃
    publicCustomerCount: post('/dt-customer/customerPublicPool/web/clueList/count'), // 公客池线索列表头部
    publicCustomerVisitCount: post('/dt-customer/customerPublicPool/web/customerList/count'), // 公客池到访列表头部

    publicCustomerExport: post('/dt-customer/customerPublicPool/web/list/export').tag('downloadCenter'),

    visitPublicCustomerExport: post('/dt-customer/customerPublicPool/web/customerList/export').tag(
      'downloadCenter'
    ),

    cluePublicCustomerExport: post('/dt-customer/customerPublicPool/web/clueList/export').tag(
      'downloadCenter'
    ),

    customerPublicPoolDistributionList: post('/dt-customer/customerPublicPoolDistribution/list'),
    customerPublicPoolDistributionExport: post('/dt-customer/customerPublicPoolDistribution/list/export').tag(
      'downloadCenter'
    ),

    distributePublicCustomer: post('/dt-customer/customerPublicPool/distributePublicCustomer'),
    wechatClueList: post('/dt-customer/wechatClueList'),

    downloadWechatClue: post('/dt-customer/downloadWechatClue').tag('downloadCenter'),
    // 公客池分配统计
    customerPublicPoolAssignmentCount: post('dt-customer/customerPublicPool/web/assignment/list/count'),
    // 公客池线索分配
    distributePublicClue: post('dt-customer/customerPublicPool/web/distributePublicClue'),
    // 公客池到访分配
    distributePublicCustomerVisit: post('dt-customer/customerPublicPool/web/distributePublicCustomer'),

    // 入池记录

    buildingPoolRecordPage: post(' /dt-customer/customerPublicPool/web/buildingPoolRecordPage'),
    buildingPoolRecordExport: post('/dt-customer/customerPublicPool/web/buildingPoolRecordExport').tag(
      'downloadCenter'
    )
  },

  // 待办任务
  task: {
    leftTaskCount: post('/dt-customer/task/web/leftTaskCount'),
    taskCount: post('/dt-customer/task//web/taskCount'),

    taskList: post('/dt-customer/task/web/taskList').setTimeout(30000),
    topTaskStatusCount: post('/dt-customer/task/web/topTaskStatusCount').setTimeout(30000),
    scoreTaskList: post('/dt-customer/task/web/score/taskList'),
    taskMsgTips: post('/dt-customer/task/taskMsgTips'),
    taskHeadInfoForWeb: get('/dt-customer/task/manage/taskHeadInfoForWeb'),
    // 案场内待办
    leftTaskCountWithBuildingId: post('/dt-customer/task/web/leftTaskCountWithBuildingId'),
    topTaskStatusCountWithBuildingId: post('/dt-customer/task/web/topTaskStatusCountWithBuildingId'),
    taskListWithBuildingId: post('/dt-customer/task/web/taskListWithBuildingId'),
    updateTask: post('/dt-customer/task/updateTask') //更新任务
  },
  //日报
  daily: {
    //配置当日到访客户列表
    checkInCustomerLists: post('/dt-customer/clUserCustomer/checkInCustomerLists'),
    //获取当日重点客户列表
    configCustomerList: post('/dt-customer/clUserCustomer/configCustomerList'),
    //获取当前月份和下个月线索目标设定
    getCurrentMonthAndNextMonth: get('/dt-customer/clSettingTargets/getCurrentMonthAndNextMonth')
  },
  //线索导入
  clueBatch: {
    //导入模板下载
    templateDownload: server.api().download('/dt-customer/clueBatch/templateDownload', 'get'),
    importFile: server.api().upload('/dt-customer/clueBatch/importFile'), //导入线索文件
    getBatchList: post('/dt-customer/clueBatch/getBatchList'), //导入批次列表查询
    deleteByBatchId: get('/dt-customer/clueBatch/deleteByBatchId'), //删除批次
    //按批次下载文件
    downloadByBatchId: server.api().download('/dt-customer/clueBatch/downloadByBatchId', 'get'),
    //获取导入记录详情列表
    getOperationDetailList: post('/dt-customer/clueBatch/getOperationDetailList'),
    allocateImportedClue: post('/dt-customer/clueBatch/allocateImportedClue'), //分配已导入的线索
    deleteByDetailIds: post('/dt-customer/clueBatch/deleteByDetailIds'), //删除待导入详情记录
    cancelByIds: post('/dt-customer/clueBatch/cancelByIds'), //撤销分配记录
    downloadOperationDetailList: post('/dt-customer/clueBatch/downloadOperationDetailList').tag(
      'downloadCenter'
    ) //导出已分配详情列表
  },
  // 工作台
  work: {
    taskHeadInfoForOrg: get('/dt-customer/task/manage/taskHeadInfoForOrg'),
    leftTaskCountWithOrg: post('/dt-customer/task/web/leftTaskCountWithOrg'),
    topTaskStatusCountWithOrg: post('/dt-customer/task/web/topTaskStatusCountWithOrg'),
    taskListWithOrg: post('/dt-customer/task/web/taskListWithOrg')
  },
  targetConfig: {
    getCurrentTargetAndAdvisorList: get('/dt-customer/clSettingTargets/getCurrentTargetAndAdvisorList')
  }
}
